---
page_title: "cloudflare_tunnel_route Resource - Cloudflare"
subcategory: ""
description: |-
  Provides a resource, that manages Cloudflare tunnel routes for Zero
  Trust. Tunnel routes are used to direct IP traffic through
  Cloudflare Tunnels.
---

# cloudflare_tunnel_route (Resource)

Provides a resource, that manages Cloudflare tunnel routes for Zero
Trust. Tunnel routes are used to direct IP traffic through
Cloudflare Tunnels.

## Example Usage

```terraform
# Tunnel route
resource "cloudflare_tunnel_route" "example" {
  account_id         = "f037e56e89293a057740de681ac9abbe"
  tunnel_id          = "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415"
  network            = "192.0.2.24/32"
  comment            = "New tunnel route for documentation"
  virtual_network_id = "bdc39a3c-3104-4c23-8ac0-9f455dda691a"
}

# Tunnel with tunnel route
resource "cloudflare_tunnel" "tunnel" {
  account_id = "f037e56e89293a057740de681ac9abbe"
  name       = "my_tunnel"
  secret     = "AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg="
}

resource "cloudflare_tunnel_route" "example" {
  account_id         = "f037e56e89293a057740de681ac9abbe"
  tunnel_id          = cloudflare_tunnel.tunnel.id
  network            = "192.0.2.24/32"
  comment            = "New tunnel route for documentation"
  virtual_network_id = "bdc39a3c-3104-4c23-8ac0-9f455dda691a"
}
```
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `account_id` (String) The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
- `network` (String) The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- `tunnel_id` (String) The ID of the tunnel that will service the tunnel route.

### Optional

- `comment` (String) Description of the tunnel route.
- `virtual_network_id` (String) The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. **Modifying this attribute will force creation of a new resource.**

### Read-Only

- `id` (String) The ID of this resource.

## Import

Import is supported using the following syntax:

```shell
$ terraform import cloudflare_tunnel_route.example <account_id>/<network_cidr>/<virtual_network_id>
```
